home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / wasm223.zip / SMUTTEST.ASM < prev    next >
Assembly Source File  |  1993-05-04  |  1KB  |  41 lines

  1. ;Test program in SMUT by D. E. Johnson
  2. ;Simple Macro-Using Translator
  3.  include 'smut.inc'    ;compiler code
  4.  expand-                  ;don't show assembly
  5. n    dw 0    ;variables
  6. fact dw 0
  7. sqr  dw 0
  8. n1   dw 0
  9. n2   dw 0
  10. quo  dw 0
  11. dif  dw 0
  12. exp  dw 0
  13.  
  14. START        ;execution begins here
  15.  DISPLAY '\This program tests a SMUT compiler'
  16.  LET n,1                  ;n=1
  17.  LET fact,n               ;fact=n
  18.  DISPLAY '\Num Square'
  19.  REPEAT
  20.    LET sqr,n,TIMES,n      ;sqr=n*n
  21.    LET fact,fact,TIMES,n  ;fact=fact*n
  22.    DISPLAY '\  '
  23.    OUTPUT n,sqr,fact
  24.    DISPLAY '=!'
  25.    LET n,n,PLUS,1         ;n=n+1
  26.  UNTIL fact,GT,32767,divby,n ;til max fact
  27.  REPEAT
  28.    DISPLAY '\Enter a positive number (& space): '
  29.    INPUT n1
  30.    DISPLAY '   and a second positive number: '
  31.    INPUT n2
  32.    LET quo,n1,DIVBY,n2
  33.    LET dif,n1,MINUS,n2
  34.    LET exp,dif,MINUS,4,TIMES,quo,PLUS,quo,MINUS,n1
  35.    DISPLAY '\Meaningless Results = '
  36.    OUTPUT n2,dif,quo,exp
  37.  UNTIL exp,LE,n2,DIVBY,3,MINUS,4
  38.  DISPLAY '\The test is completed!\'
  39.  STOP
  40.    
  41.